#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pii pair<int,int>
#define pb push_back
#define vec vector<int>
#define y1 y_____hahahaha_____1

using namespace std;

typedef long long ll;
typedef double db;
typedef unsigned long long ull;
typedef long double ldb;

int read(){int x = 0,sgn = 1;char ch = getchar();for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;for(;isdigit(ch);ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ 48); return x * sgn;}

const int N = 2e5+10;

char a[N];
int col[26],nxt[N],f[N],n,npos[N];

int main(){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	scanf("%s",a + 1); n = strlen(a + 1);
	for(int i = 0;i < 26;i++) col[i] = n + 1; f[n + 1] = 0;
	for(int i = n;i >= 0;i--){
		f[i] = n + 100;
		for(int j = 0;j < 26;j++) if(f[col[j]] + 1 < f[i]) f[i] = f[col[j]] + 1,npos[i] = col[j],nxt[i] = j;
		if(i) col[a[i] - 'a'] = i;
	}
	int cur = 0;
	while(cur ^ (n + 1)) putchar(nxt[cur] + 'a'),cur = npos[cur];
	return 0;
}
